#pragma once
#ifndef __AI_Manager_h_
#define __AI_Manager_h_

#include "AI_TrackPath.h"
#include "AI_Agent.h"
#include "Player.h"
class AI_Agent;

class AI_Manager
{
public:
	AI_Manager(Ogre::SceneManager* sceneMgr, OgreBulletDynamics::DynamicsWorld* world, OgreOggSound::OgreOggSoundManager *soundManager,
		       std::vector<Vector3> agentStartPos, std::vector<Waypoint>* waypoints, std::vector<TimingGate> *gates, Real *raceTime);
	~AI_Manager(void);
	void update(Ogre::Real elapsedTime, GameState state);
	int getAgentWaypoint(int index);
	Real getAgentVelocity(int index);
	int calculatePlayerPosition(Player *p);
	int numAgents();
	void startSound();
	void setRacingVolume();
protected:
	Ogre::SceneManager *mSceneMgr;
	OgreBulletDynamics::DynamicsWorld *mWorld;
	std::vector<Waypoint> *currWaypoints;
	AI_TrackPath *mTrackPath;
	std::vector<AI_Agent*> mAgents;
	OgreOggSound::OgreOggSoundManager *mSoundManager;
	bool mEngineGainChanged;
	bool soundStarted;
};
#endif // #ifndef __AI_Manager_h_